/**
 * 
 */
package com.module.bp.event.numbered;

import com.dalonedrau.jogl.opengl.TextLoader;
import com.dalonedrau.jogl.opengl.animation.AnimConsts;
import com.module.bp.engine.BPRand;
import com.module.bp.engine.Turn;
import com.module.bp.event.base.AnimationEvent;
import com.module.bp.event.base.BaseEvent;
import com.module.bp.event.base.CenterMapOnPartyEvent;
import com.module.bp.event.base.SmallMessageEvent;
import com.module.bp.event.base.TeleportPartyEvent;
import com.module.bp.player.BPParty;

/**
 * @author Donald
 *
 */
public final class EventE001 extends BaseEvent {
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void setUserInput(final int input) {
		// TODO Auto-generated method stub
		
	}
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void fire() throws Exception {
		TeleportPartyEvent te = new TeleportPartyEvent();
		te.setAnimated(false);
		switch (BPRand.getInstance().rollD6()) {
		case 1:
			te.setLocation(1, 1);
			break;
		case 2:
			te.setLocation(7, 1);
			break;
		case 3:
			te.setLocation(8, 1);
			break;
		case 4:
			te.setLocation(13, 1);
			break;
		case 5:
			te.setLocation(15, 1);
			break;
		default:
			te.setLocation(18, 1);
			break;
		}
		te.setLocation(1, 1);
		Turn.getInstance().addEventAfterId(super.getId(), 
				te,
				new CenterMapOnPartyEvent(),
				new AnimationEvent(
				BPParty.getInstance().getWorldMapSprite(),
				"party_walk_d",
				AnimConsts.ANIM_REPEATS_FROM_STARTKEYFRAME
				),
				new SmallMessageEvent("Start the Game", 
				TextLoader.getInstance().loadText("e001.txt")),
				new AnimationEvent(
				BPParty.getInstance().getWorldMapSprite(),
				"party_walk_d",
				AnimConsts.ANIM_GOTO_END_FRAME
				));
		BPParty.getInstance().resetNumberOfMoves();
		super.setFired(true);
		super.setResolved(true);
	}
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void setUserInput(final boolean input) { }
}
